import requests
from lxml import etree

headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36",
}
data = {
    "mobile": "irw27812@awsoo.com",
    "password": "shoujn1108",
}
param = {
    "rank": "product",
    "time_type": "daily",
    "time": 1712505600,
    "sort_type": "sold",
    "region": "US",
    "page": 3,
    "page_size": 20,
    "appid": 2310,
    "_signature": "94c64cea039c9ca6a1c7ce3bb3e935de",
    "_ts": 1712644752,
}

tabcut_param = {
    "pageNo": 2,
    "pageSize": 20,
    "rankType": 1,
    "bizDate": 20240409,
    "region": US,
    "itemCategoryId": 0,
    "sortField": 60,
    "trendFilterType": 0,
}
tabcut = "https://api.didadog.com/api/v2/auth/pwd_login"
session = requests.Session()
session.post(url, headers=headers, data=data)
# 登录后，我们需要获取另一个网页中的内容
response = session.get(
    "https://didadog.com/api/data/v1/rank", params=param, headers=headers
)
response.encoding = "utf-8"
_signature = response.cookies.get("_signature")
print(_signature)
print(response.status_code)
print(response.text)


# 6fd474579ad7c649061bfb5965a8c1f4
# 94c64cea039c9ca6a1c7ce3bb3e935de

# /html/body/div[1]/div/div[1]/div/section/section/main/div/div/div[3]/div/div/div/div/div/div/div/div/div/table/tbody


# html = etree.HTML(response.text)
# ret = html.xpath("//body/div")
# print(ret)
